package com.cf.spider.core.push;

import com.cf.spider.core.model.JobTask;
import com.cf.spider.core.model.service.JobTaskService;
import com.cf.util.NumberUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * game-server-UpdateListener
 *
 * @author <a href="2428922347@qq.com">Zhu mingming</a>
 * @info
 * @since 2018/6/8 下午 04:28
 */
@Slf4j
public class PushResultListener {

    @Autowired
    private JobTaskService jobTaskService;

    public void listen(String msg) {
        boolean digit = NumberUtil.isDigit(msg);
        if (digit) {
            JobTask jobTask = jobTaskService.selectOne(Long.parseLong(msg));
            jobTaskService.end(jobTask);
        }
    }

}
